'use strict';
 module.exports = function collectSameElements(collectionA,collectionB) {
    let arr=collectionB.value;
    var ab=[];
    for(var ai=0;ai<collectionA.length;ai++){
      for(var bi=0;bi<arr.length;bi++){
        if(collectionA[ai]==arr[bi]){
         ab.push(collectionA[ai]);
        }
      }
    }
  return ab;
  console.log(ab);
}
// const collectionA = ['a', 'e', 'h', 't', 'f', 'c', 'g', 'b', 'd'];
// const collectionB = {value: ['a', 'd', 'e', 'f']};
// console.log(collectSameElements(collectionA, collectionB));
